package com.senlingspace.payment.douyin.bean.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * 抖音获取client_token响应
 * <p>
 * 成功响应：{"data":{"access_token":"clt.2403521ab04b157a54583c114d21fd97IfdTBNxWBdwecgKGnSlLA9OaT18L_lq","error_code":0,"expires_in":7200},"message":"success"}
 * <p>
 * 失败响应：{"data":{"description":"配置无效","error_code":10003},"message":"error"}
 *
 * @author lebronjames
 * @date 2024/07/22
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DouyinTokenResponse implements Serializable {

    @JsonProperty("data")
    private ResponseData data;

    /**
     * 请求响应
     */
    @JsonProperty("message")
    private String message;

    @Data
    public static class ResponseData implements Serializable {

        /**
         * client_token 接口调用凭证
         */
        @JsonProperty("access_token")
        private String accessToken;

        @JsonProperty("description")
        private String description;

        /**
         * 10002：参数错误
         * 10003：client_key 不存在
         * 10013：client_key 或者 client_secret 报错
         */
        @JsonProperty("error_code")
        private int errorCode;

        /**
         * client_token 接口调用凭证超时时间，单位（秒）
         */
        @JsonProperty("expires_in")
        private Long expiresIn;

        @JsonProperty("captcha")
        private String captcha;

        @JsonProperty("desc_url")
        private String descUrl;

    }

}
